// 接口
interface IPerson {
  name: string,
  age: number,
  sayHi(): void
}
// 类型别名
// type IPerson = {
//   name: string,
//   age: number,
//   sayHi(): void
// }

let Person: IPerson = {
  name: 'jack',
  age: 19,
  sayHi() { }
}

// 继承
interface IPerson1 extends IPerson {
  sayHello(): void
}

let Person1: IPerson1 = {
  name: 'jack',
  age: 19,
  sayHi() { },
  sayHello() { }
}

// 任意属性 和 只读属性
interface IPerson2 {
  readonly id: number,
  name: string,
  age?: number,
  [n: string]: string | number | undefined,
}

let Person2: IPerson2 = {
  id: 1,
  name: 'mark',
  gender: 'F'
}